<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <meta charset="UTF-8"/>
	    <#assign base=request.contextPath  />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>login</title>
    <link rel="stylesheet" type="text/css" href="${base}/css/login/normalize.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/css/login/demo.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/css/cloud.css"/>
    <link rel="stylesheet" href="${base}/frame/layui/css/layui.css">
    <script type="text/javascript" src="${base}/frame/layui/layui.all.js"></script>
    <!--必要样式-->
    <link rel="stylesheet" type="text/css" href="${base}/css/login/component.css"/>
    <script src="${base}/js/html5.js"></script>
    <script src="${base}/js/jquery.min.js"></script>
    <script src="${base}/js/jquery.blockUI.js"></script>
    <script src="${base}/js/cloud.js"></script>
</head>
<body>
<script>
    //控制跳出ifream框架
    if (window != top)
        top.location.href = location.href;
</script>
<div class="container demo-1">
    <div class="content">
        <div id="large-header" class="large-header">
            <canvas id="demo-canvas"></canvas>
            <div class="logo_box">
                <h3>欢迎你</h3>

                <div class="input_outer">
                    <span class="u_user"></span>
                    <input id="userName" class="text" style="color: #FFFFFF !important" type="text"  >
                </div>
                <div class="input_outer">
                    <span class="us_uer"></span>
                    <input id="passWord" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;"
                           type="password"  >
                </div>
                <div class="mb2"><a onclick="login()" class="act-but submit" href="javascript:;" style="color: #FFFFFF"
                                    data-loading="正在验证登录，请稍后...">登录</a></div>

            </div>
        </div>
    </div>
</div><!-- /container -->
<script src="${base}/js/TweenLite.min.js"></script>
<script src="${base}/js/EasePack.min.js"></script>
<script src="${base}/js/rAF.js"></script>
<script src="${base}/js/demo-1.js"></script>
<script>
    function login() {
/*        var goodIds= {"taobao":["535407014934"],"pinduoduo":[]} ;
        $.ajax({
            type: 'POST',
            url: 'http://localhost/pdd/findGoodsInfoByIds',
            data: {"goodIds":JSON.stringify(goodIds)}  ,
            contentType:"application/x-www-form-urlencoded",
            success: function (data) {
            }
        });

        return;*/
        if ($("#userName").val() == "" || $("#userName").val() == null) {
            layer.msg("请正确输入账户", {icon: 5})
            return;
        }
        if ($("#passWord").val() == "" || $("#passWord").val() == null) {
            layer.msg("请正确输入密码", {icon: 5})
            return;
        }

        $.modal.loading("请稍后...");
        setTimeout(function () {
            $.ajax({
                type: "get",
                url: "${base}/admin/login",
                async: false,
                data: {
                    "userName": $("#userName").val(),
                    "passWord": $("#passWord").val()
                },
                success: function (data) {
                    if (data === false) {
                        layer.msg("口令错误", {icon: 5})
                    } else {
                        window.location.href = "${base}/admin/main.html"
                    }
                    $.modal.closeLoading();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $.modal.closeLoading();
                }
            });
        }, 500)

    }
</script>
</body>
</html>